package com.isnmp.common.snmp.impl;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.List;

import com.isnmp.common.base.MyException;
import com.isnmp.common.base.MyLog;
import com.isnmp.common.base.RMINamingServer;
import com.isnmp.common.snmp.SNMPAPI;
import com.isnmp.common.snmp.SNMPTarget;

public class RMISNMPAPIImpl extends UnicastRemoteObject implements SNMPAPI {
    private static Remote remote;

    public RMISNMPAPIImpl() throws RemoteException {
    }

    public static void startServ() throws RemoteException, MyException, MalformedURLException {
        RMINamingServer.startRMINaming();
        remote = new RMISNMPAPIImpl();
        Naming.rebind("//127.0.0.1:" + RMINamingServer.rmiPort + "/SNMPServer", remote);
        SNMPAPIImpl.getInstance();
        MyLog.log("SNMP RMI service started OK!");
    }

    public void checkSnmpAgentActive(SNMPTarget paramSNMPTarget) throws MyException, RemoteException {
        SNMPAPIImpl.getInstance().checkSnmpAgentActive(paramSNMPTarget);
    }

    public void addTableRow(Object paramObject, SNMPTarget paramSNMPTarget) throws MyException, RemoteException {
        SNMPAPIImpl.getInstance().addTableRow(paramObject, paramSNMPTarget);
    }

    public void delTableRow(Object paramObject, SNMPTarget paramSNMPTarget) throws MyException, RemoteException {
        SNMPAPIImpl.getInstance().delTableRow(paramObject, paramSNMPTarget);
    }

    public List getAllTableData(Class paramClass, SNMPTarget paramSNMPTarget) throws MyException, RemoteException {
        return SNMPAPIImpl.getInstance().getAllTableData(paramClass, paramSNMPTarget);
    }

    public List<List<String>> getAllOIDTableData(SNMPTarget paramSNMPTarget, List<String> paramList) throws MyException {
        return SNMPAPIImpl.getInstance().getAllOIDTableData(paramSNMPTarget, paramList);
    }

    public String getOIDValue(String paramString, SNMPTarget paramSNMPTarget) throws MyException, RemoteException {
        return SNMPAPIImpl.getInstance().getOIDValue(paramString, paramSNMPTarget);
    }

    public String getNextOIDValue(String paramString, SNMPTarget paramSNMPTarget) throws MyException, RemoteException {
        return SNMPAPIImpl.getInstance().getNextOIDValue(paramString, paramSNMPTarget);
    }

    public void setOIDValue(String paramString1, String paramString2, String paramString3, SNMPTarget paramSNMPTarget) throws MyException, RemoteException {
        SNMPAPIImpl.getInstance().setOIDValue(paramString1, paramString2, paramString3, paramSNMPTarget);
    }

    public Object getMibObject(Object paramObject, SNMPTarget paramSNMPTarget) throws MyException, RemoteException {
        return SNMPAPIImpl.getInstance().getMibObject(paramObject, paramSNMPTarget);
    }

    public long getOIDLongValue(String paramString, SNMPTarget paramSNMPTarget) throws MyException {
        return SNMPAPIImpl.getInstance().getOIDLongValue(paramString, paramSNMPTarget);
    }

    public void update(Object paramObject, SNMPTarget paramSNMPTarget) throws MyException, RemoteException {
        SNMPAPIImpl.getInstance().update(paramObject, paramSNMPTarget);
    }
}